let newsModel = require("../services/newsmodel.js");
module.exports = {
    renderIndex:async ctx=>{
        await ctx.render("newsindex.html");
     },
     renderNewsList:async ctx=>{
         await ctx.render("newslist.html");
     },
     getdata: async ctx=>{
        let p = ctx.query.p;


        // 输出新闻列表数据
       let data = await newsModel.getdata(p);
       let pcount = await newsModel.getPageCount();
       ctx.body = {data,pcount};
     }
}